<?php

//服务器和数据库信息
$servername = "localhost";
$username = "root";
$password = "";
$dbName = "mydb";
$tableName = "myguest";

//create connection
$conn = new mysqli($servername, $username, $password, $dbName);

//check connection 
if ($conn->connect_error) {
  die('fail to connect' . $conn->connect_error);
}

// $conn->autocommit(false);
$sql = 'SET GLOBAL  TRANSACTION ISOLATION LEVEL READ UNCOMMITTED ';//| READ COMMITTED | REPEATABLE READ | SERIALIZABLE}'
$result = $conn->query($sql);
var_dump($result);
$sql = "SELECT @@global.tx_isolation;";
$sql .= "SELECT @@session.tx_isolation;";
$sql .= "SELECT @@tx_isolation";
$sql = explode(';', $sql);
foreach ($sql as $value) {
  // echo ($value);
  $result = $conn->query($value);
  // var_dump($result);
  if ($result) {
    while ($row = $result->fetch_assoc()) {

      var_dump($row);
    }
  } else {
    echo ('no');
  }
}


